ARCH=arm
CROSS_COMPILE=/d/buildroot-v23434/buildroot/build_arm/staging_dir/usr/bin/arm-linux-
CC=$(CROSS_COMPILE)gcc
STRIP=$(CROSS_COMPILE)strip

#CFLAGS = -Wall -lm -fsigned-char
CFLAGS = -lm -fsigned-char -Wall -Wno-pointer-sign -Wno-unused-variable
#CFLAGS = -fsigned-char

TARGET = iGDU
OBJS = iGDU


LIBS = gpsclock.c
LIBS += devices.c
LIBS += ipc.c
LIBS += fpga/fpga.c
LIBS += fpga/cnt.S
LIBS += RCGDM/main.c
LIBS += RCGDM/Cmd.c
LIBS += RCGDM/Command.c
LIBS += RCGDM/Config.c
LIBS += RCGDM/Control.c
LIBS += RCGDM/Counter.c
LIBS += RCGDM/Ctrlfunc.c
LIBS += RCGDM/Ctrlmon.c 
LIBS += RCGDM/Diag.c 
LIBS += RCGDM/Dual.c 
LIBS += RCGDM/E1.c
LIBS += RCGDM/Eb.c
LIBS += RCGDM/Ebcmd.c
LIBS += RCGDM/Etc.c
LIBS += RCGDM/Holdover.c
LIBS += RCGDM/Led.c
LIBS += RCGDM/LMU.c
LIBS += RCGDM/Mainfunc.c
LIBS += RCGDM/Matrix.c
LIBS += RCGDM/Log.c
LIBS += RCGDM/Navicmd.c
LIBS += RCGDM/Ocxo.c
LIBS += RCGDM/Odtcmd.c
LIBS += RCGDM/Offset.c
LIBS += RCGDM/Pll.c
LIBS += RCGDM/Position.c
LIBS += RCGDM/Rb.c
LIBS += RCGDM/Recovery.c
LIBS += RCGDM/Rtc.c
LIBS += RCGDM/Scc.c
LIBS += RCGDM/Startup1.c
LIBS += RCGDM/Status.c
LIBS += RCGDM/Switch.c
LIBS += RCGDM/timer.c
LIBS += RCGDM/Tod.c
LIBS += RCGDM/Trace.c
LIBS += RCGDM/Version.c
LIBS += RCGDM/nmea_f1000c.c
LIBS += RCGDM/oemv3_msg.c
LIBS += RCGDM/Compare.c
LIBS += RCGDM/VME.c
LIBS += udpd/*.c
#LIBS += udpd/msg.c
#LIBS += udpd/crc_kti.c
#LIBS += udpd/fwup.c
#LIBS += udpd/net.c


SRCS = $(OBJS:.o=.c)

# .map file create
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref

default:
#	$(CC) $(CFLAGS) $(LDFLAGS) -o $(OBJS) $(LIBS)
#	$(STRIP) -s $(OBJS)
#	chmod +x $(OBJS)
#	cp -rf $(OBJS) /d/rcu-g/ImageMake/mkgrcagz-f1000c-38400/fwfiles/
#	gzip -f $(OBJS).gz $(OBJS)
#	cp -rf $(OBJS).gz /home/Share/
#	lftp -c "put -O ftp://DEV:DEV1@118.220.37.168:100 $(OBJS).gz"
all:
	rm -rf *.o
	$(CC) $(CFLAGS) -o $(OBJS) $(LIBS)
	$(STRIP) -s $(OBJS) 
	
	chmod +x $(OBJS)
	cp -rf $(OBJS) $(OBJS).bak
#	cp -rf $(OBJS) /d/rcu-g/ImageMake/mkgrcagz-f1000c-38400/fwfiles/
	gzip -f $(OBJS).gz $(OBJS)
	cp -rf $(OBJS).gz /home/Share/
#	cp -rf $(OBJS) /nfsroot/
#Through
#	lftp -c "put -O ftp://DEV:DEV1@118.220.37.168:100 $(OBJS).gz"
#HyunSoo
#	lftp -c "put -O ftp://DEV:DEV1@118.220.37.172:100 $(OBJS).gz"
	
clean:
	rm -rf *.o

